const router = require('koa-router')();
const policy = require('../modules/policy');

//获取数据
router.get('/exampolicy',async(ctx,next) => {
    ctx.body = await policy.getexamPolicy();
})
//增加数据
router.post('/exampolicy',async(ctx,next) => {
    ctx.body = await policy.addexamPolicy(ctx.request.body);
})
//删除数据
router.delete('/exampolicy/:policy_id',async(ctx,next) => {
    ctx.body = await policy.deleteexamPolicy(ctx.params);
})
//修改数据
router.put('/exampolicy',async(ctx,next)=>{
    ctx.body = await policy.putexamPolicy(ctx.request.body);
})

module.exports = router;
